package com.ln.dao.impl;

import org.springframework.stereotype.Repository;

import com.ln.dao.BaseDAO;
import com.ln.dto.ParamsMap;
import com.ln.pojo.impl.UserPOJO;

@Repository
public class UserDAO extends BaseDAO<UserPOJO, Integer> {

	public UserDAO() {
		super(UserPOJO.class);
	}

	public UserPOJO login(final UserPOJO pojo) {
		return getSqlSession().selectOne("UserPOJO.login", pojo);
	}
	
	public int isExistEmail(final String email) {
		return getSqlSession().selectOne("UserPOJO.isExistEmail", email);
	}
	
	public int updatePassword(ParamsMap paramsMap) {
		return getSqlSession().update("UserPOJO.updatePassword", paramsMap);
	}
	
	public String selectPassword(final int user_id) {
		return getSqlSession().selectOne("UserPOJO.selectPassword", user_id);
	}

}
